﻿ <%--
 *  File:   VisitPlanTempetMain.jsp
 *  Desc:	main page for lend slip
 *
 *  Date		         Author		      Changes
 *  2009-11-5 8:55:43	  kentzhong		  Created
 *
 *  Copyright (C) 2000 - 2009 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%
  //init param
  String privilegeCode = "H0256";
  String strModuleName = "SFE";
  String contextPath = request.getContextPath();
%>
<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.customtag.element.*"%>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%@ include file="/inc/Security.inc" %>
 <%@ include file="/inc/PreparePageBack.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%
    String displayflag = null;
    if(request.getParameter("displayflag")!=null&&request.getParameter("displayflag").length()!=0)
        displayflag=request.getParameter("displayflag");
    if(pageContext.getAttribute("displayflag")!=null)
        displayflag=(String)pageContext.getAttribute("displayflag");
    if(displayflag==null && session.getAttribute("displayflag")!=null)
        displayflag = (String)session.getAttribute("displayflag");
    boolean isView = "view".equalsIgnoreCase(displayflag);
    boolean isEdit = "edit".equalsIgnoreCase(displayflag);
    String needClass = isView?"td-text":"need";
    String needClassOnce = (isView||isEdit)?"td-text":"need";
%>

<html>
<head>
<title>VisitPlanTempetMain</title>
<PageFlow:CheckPageFlow pageName="p_plandaytempetmain"/>
<%@ include file="/inc/CatchError.inc" %>


<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/Calendar.js"></script>
<%
boolean isnew=false;
if(pageContext.getAttribute("visitplandaytempletid")==null)
	isnew=true;
  HashMap visitplantempletinfo = (HashMap)pageContext.getAttribute("visitplantempletinfo");
  if(visitplantempletinfo == null) 
	  visitplantempletinfo = new HashMap();	
%>
<%--  edit page related functions   --%>
<%if(!isView){%><script language="JavaScript">

function page_save()
{
    if(!checkForm(cform))   return;
    var defaultprocessid = document.cform.defaultprocessid.value;
    if (defaultprocessid == " ") {
    	alert("<%= message.getMessageDesc("Select_DefaultProcess") %>");
    	return;
    }
    
    formatDate(cform);
	cform.actionname.value = "save";
	cform.target = "_parent";
	isRunning = true;
	//cform.templettype.disabled=false;
	cform.submit();
}
</script><%}%>

<%--  other functions   --%>
<script language="JavaScript">

</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="overflow: auto;">
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
    <input type="hidden" name="pagename" value="p_plandaytempetmain">
    <input type="hidden" name="actionname">
		<custom:hidden property="contactid"/>
		<custom:hidden property="visitplandaytempletid"/>
		<custom:hidden  property="orgid"/>	
<table border=0 cellpadding=0 cellspacing=0 width="100%">
  <tr>
    <td valign=top>
      <table border=0 cellpadding=1 cellspacing=0 width="100%">
        <tr>
          <td bgcolor=#000000 style="PADDING-BOTTOM: 1px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 0px">
            <table bgcolor=#000000 border=0 cellpadding=0 cellspacing=0 width="100%">
              <tr>
                <td  bgcolor=#ffffff style="PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; PADDING-TOP: 3px" valign="top">
                  <div id=div2 style="HEIGHT: 415px; OVERFLOW: auto;">
                    <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="1">

<%--    top function buttons    --%>
<% if(!isView){%>
                      <tr>
                        <td colspan="4" class="td_right" height="18">
                          <a onclick="page_save()"><custom:button type="2" label="L_Save" imgsrc="save_btn.gif" border="0" /></a>
                        </td>
                      </tr>
<%}%>

<%--    main trs    --%>
                      <tr>
                        <td width="150" class="<%=JspHelper.filterNull(needClass)%>" id="autocode"> <%=label.getLabelName("L_TempletCode")+label.getLabelName("L_Colon")%></td>
                        <td width="300"> 
                        	<!--<custom:autocode name="visitplantempletinfo" property="templetcode" table="visitplantemplet"  label="L_TempletCode"/>-->
                        	<custom:write name="visitplantempletinfo" property="templetcode" nbsp="true"/>
                        </td>
                        <td width="150" class="<%=JspHelper.filterNull(needClass)%>" ><%=label.getLabelName("L_Status")+label.getLabelName("L_Colon")%></td>
                        <td> 
                        	<custom:selectdic name="visitplantempletinfo" property="status" dictType="Status" valueCriteria="28,41"  command="notnull"    label="L_TempletStatus" sortOrder="desc"/>
           							 </td>
                      </tr>
                      <tr>
                        <td class="<%=JspHelper.filterNull(needClass)%>"> <%=label.getLabelName("L_TempletName")+label.getLabelName("L_Colon")%></td>
                        <td ><custom:text name="visitplantempletinfo" property="templetname"   size="20" command="notnull"  module="SFE"  label="L_TempletName"/></td>
                        <td  class="td-text" ><%=label.getLabelName("L_Maker")+label.getLabelName("L_Colon")%></td>
                        <td>
                        	<%if(isnew){
                        	%>
                        	<custom:write name="contactinfo" property="employeecode" nbsp="true"/> 
                        	<custom:write name="contactinfo" property="employeename" nbsp="true"/>
                        	<%}else{%>	
                        	<custom:write name="visitplantempletinfo" property="employeecode" nbsp="true"/>
                        	<custom:write name="visitplantempletinfo" property="employeename" nbsp="true"/>
                        	<%}%>
                        </td>
                      </tr>
                      <tr>
                             <%--<td class="<%=JspHelper.filterNull(needClass)%>"> <%=label.getLabelName("L_TempletType")+label.getLabelName("L_Colon")%></td>
                        <td >
                        	<custom:selectdic disabled="true" name="visitplantempletinfo" property="templettype" dictType="SFETempletType" command="notnull"   label="L_TempletType" />
           					</td>--%>
           							 
           				<td class="<%=JspHelper.filterNull(needClass)%>" ><%=label.getLabelName("L_DefaultVisitProcess")+label.getLabelName("L_Colon")%></td>
                        <td><custom:select  optionsName="allprocessname" optionValueKey="visitprocessid" optionInnerTextKey="processname" name="visitplantempletinfo"	property="defaultprocessid"  defaultValue="----" defaultValueCost=" "/></td>
                     	  <td class="td-text"> <%=label.getLabelName("L_CreateDate")+label.getLabelName("L_Colon")%></td>
                        <td > 
                        	<%if(isnew){
                        	%>
                        	<%=OvalTools.getDate((String)session.getAttribute("dateformat"))%>
                        	<%}else{%>	
                        	<custom:write name="visitplantempletinfo" property="createdate" dataType="date"  dataFormatName="dateformat" nbsp="true"/>
                        	<%}%>
                        	</td>
                      </tr>
				      <!--  <tr>

                        <td class="td-text"> <%=label.getLabelName("L_Maker")+label.getLabelName("L_Colon")%></td>
                        <td colspan="3">
                        </td>
                      </tr>
                      -->
                      <tr>
                        <td class="td-text"> <%=label.getLabelName("L_Comments")+label.getLabelName("L_Colon")%></td>
                        <td colspan="3" > <custom:textarea name="visitplantempletinfo" property="description" cols="45" rows="4"/></td>
                      </tr>

<%--    form hidden elements    --%>
                      <tr>
                        <td style="display:none">
                        	<%if(isnew){
                        	%>
                        	<custom:hidden name="userinfo" property="userid" changedName="maker" scope="session"/>
            	            <%}%>
                        </td>
                      </tr>

                    </table>
                  </div>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
    <tr><td class="summary_top"></td></tr>
  <tr>
    <td class="td_center">
		<a onclick="parent.location.href='VisitPlanDayTempletSummary.jsp?contactid=<custom:write property="contactid"/>&orgid=<custom:write  property="orgid"/>&<%= OvalTools.randomURL() %>';">
			<custom:button type="1" label="L_Back" imgsrc="back.gif" border="0" style="width:60"/>
		</a>
	</td>
</tr>	
</table>
</form>
</body>

</html>
